<template>
  <el-dialog
    title="新增"
    :visible.sync="isYxDialogShow"
    width="40%"
    @close="closeAll"
  >
    <div style="padding: 30px">
      <el-form ref="form" :model="form" label-width="80px">
        <el-form-item label="组织">
          <TreeSelect
            :data="options"
            :props="propsTree"
            v-model="form.select"
            size="normal"
            @input="treeInput"
            :style="{ height: '36px' }"
          />
        </el-form-item>
        <el-form-item label="区域基价">
          <el-input v-model="form.name"></el-input>
        </el-form-item>
      </el-form>
    </div>

    <span slot="footer" class="dialog-footer">
      <el-button @click="closeAll">取 消</el-button>
      <el-button type="primary" @click="sureData">确 定</el-button>
    </span>
  </el-dialog>
</template>
<script>
import Dic from "../../../customerManage/custom";
import TreeSelect from "@/components/busComponents/NewComponents/SelectTree";
export default {
  props: {
    isYxDialogShow: {
      type: Boolean,
      default: false,
    },
  },
  components: { Dic, TreeSelect },
  data() {
    return {
      dicId: null,
      form: {},
      propsTree: {
        label: "name",
        children: "children",
      },
      options: [],
    };
  },
  methods: {
    treeInput(id) {
      console.log({ id });
      //   this.dataValue.select = id;
      //   const value = this.dataValue.select === '其他' ? this.dataValue.otherValue.trim() : this.dataValue.select
      //   this.$emit('input', value)
      //   this.$emit('change', value)
      //   this.dispatch('ElFormItem', 'el.form.change', value)
    },
    getId(val) {
      console.log("ozz", { val });

      this.dicId = val;
    },
    sureData() {
      this.$emit("addCustomFn", this.dicId);
      this.$emit("closeFn", false);
    },
    closeAll() {
      this.$emit("closeFn", false);
    },
  },
  created() {
    // console.log(this.closeFn);
  },
};
</script>
<style lang="scss" scoped></style>
